package com.liu.springboot.study;

import com.liu.springboot.study.interceptor.StudentInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by LIUJC9 on 2017/12/6.
 */
@Configuration
public class StudentWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
    private final static Logger logger = LoggerFactory.getLogger(StudentWebMvcConfigurerAdapter.class);
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        logger.info("EntWebMvcConfigurerAdapter.addInterceptors");
        registry.addInterceptor(new StudentInterceptor()).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
